import React from 'react';
import './index.less';

const TextBlock = ({ title, dataBg, children, className }) => {
  const classNames = ['web-page-block', 'text-block'];
  if (dataBg) {
    classNames.push('text-block-bg');
  }
  if (className) {
    classNames.push(className);
  }
  return (
    <div className={classNames.join(' ')}>
      <div className='web-page-block-content'>
        {title ? <h2 className='text-block-title'>{title} </h2> : null}
        <p className='text-block-content'>
          <span>{children}</span>
        </p>
        <br />
      </div>
    </div>
  );
}

export default TextBlock;